var moment = require('moment');
module.exports = function(sequelize){
    var Sequelize = require('sequelize');
    var job = sequelize.define('job',{
        id:{
            type:Sequelize.STRING,
            primaryKey:true,
            allowNull:false
        },
        click:{
            type:Sequelize.STRING
        },
        company:{
            type:Sequelize.STRING
        },
        place:{
            type:Sequelize.STRING
        },
        time:{
            type:Sequelize.DATE,
            get() {
                return moment(this.getDataValue('time')).format('YYYY-MM-DD HH:mm:ss');
            }
        },
        info:{
            type:Sequelize.STRING
        }
    },{
        freezeTableName: true,
        timestamps: false
    });
    return job;
};